http: revert 06cfff93, fixes overridden options#1467
http: revert 06cfff93, fixes overridden options#1467brendanashworth wants to merge 4 commits intonodejs:masterfrom
Conversation
There was a problem hiding this comment.
I thought const didn't work in sloppy mode?
There was a problem hiding this comment.
It didn't originally error for me, but I also thought so too so I added 'use strict'; in the new commit.
|
Would it be possible to split this in |
This reverts commit 06cfff9. Reverted because it introduced a regression where (because options were modified in the later functionality) options.host and options.port would be overridden with values provided in other, supported ways.
This commit adds a test to ensure all options are NOT modified after passing them to http.request. Specifically options.host and options.port are the most prominent that would previously error, but add the other options that have default values. options.host and options.port were overridden for the one-argument net.createConnection(options) call.
1c7778d to
6e5cc0a
Compare
|
Updated for your comments @bnoordhuis. The revert commit has a title of longer than 50 chars now, I hope that is ok? |
|
Yes, revert commits get dispensation. LGTM. |
|
Is this okay as semver-patch? |
|
I would say so. It fixes a regression. |
|
Awesome, merging. |
This commit adds a test to ensure all options are NOT modified after passing them to http.request. Specifically options.host and options.port are the most prominent that would previously error, but add the other options that have default values. options.host and options.port were overridden for the one-argument net.createConnection(options) call. PR-URL: #1467 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
|
|
|
personally i would at least change it to |
|
.. isn't this a breaking change though? I guess it landed on master, but still. Weekend patches. |
+1 |
|
@jonathanong maybe reopen #592? |
|
sure |
|
nope... too many tests are failing for me. |
This commit reverts commit 06cfff9 and adds a test that failed before
the revert. Options is in fact overridden in the code below the
util._extend()call (specificallyoptions.port and options.host) toallow for a one-argument
net.createConnection(options)call.Alternatives
Since this commit could be
semver-majoras it reverts functionality that's been there for a while, even though the parent commit introduced a regression that should've beensemver-majortoo, we should look into alternatives. These are some I see:_http_client.js, handlecreateConnectiondifferently (I already have different functionality we could try in a separate branch I haven't PR'ed yet). I'm 👍 on this functionality.cc @jonathanong
ref #62 #593